package org.xx.armory.spring5.security;

import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.xx.armory.spring5.junit.H2DbUnitHelper;

@SpringBootConfiguration
@EnableTransactionManagement
@EnableAutoConfiguration(exclude = {HibernateJpaAutoConfiguration.class})
public class Config {
    @Bean
    public JdbcAuthenticationDao jdbcAuthenticationDao() {
        return new JdbcAuthenticationDao();
    }

    @Bean
    public H2DbUnitHelper h2DbUnitHelper() {
        return new H2DbUnitHelper();
    }

    @Bean
    public PasswordEncoder passwordEncoder() {
        return new SimplePasswordEncoder();
    }
}
